<template>
  <view class="cellect flex flex-bt">
    <view @click="toTask" class="item flex flex-c flex-a-c">
      <text class="num deep-dark fs-28 bold">{{
        userinfo.taskCount || 0
      }}</text>
      <text class="name fs-28 bold">我的推广</text>
    </view>
    <view
      @click="jump('/pages/mine/collection/index')"
      class="item flex flex-c flex-a-c"
    >
      <text class="num deep-dark fs-28 bold">{{
        userinfo.collectCount || 0
      }}</text>
      <text class="name fs-28 bold">收藏夹</text>
    </view>
    <view
      @click="jump('/pages/mine/dramaViews/index')"
      class="item flex flex-c flex-a-c"
    >
      <text class="num deep-dark fs-28 bold">{{
        userinfo.viewCount || 0
      }}</text>
      <text class="name fs-28 bold">最近浏览</text>
    </view>
  </view>
</template>
<script>
// import { getLocalUserInfo } from "../../../assets/utils";
export default {
  props: {
    userinfo: {
      type: Object,
      default: () => {},
    },
  },
  onShow() {},
  methods: {
    toTask(){
      uni.switchTab({
        url: "/pages/extend/index",
      });
    },
    jump(url) {
      if (!this.userinfo.userId) {
        return uni.navigateTo({
          url: "/pages/login/index",
        });
      }
      uni.navigateTo({
        url,
      });
    },
  },
};
</script>
<style lang="less" scoped>
@import url("../../../assets/styles/common.less");
.cellect {
  width: 100%;
  border-radius: 16rpx;
  background: #ffffff;
  margin-top: 32rpx;
  padding: 32rpx 0;
  .item {
    flex: 1;
    position: relative;
    .name {
      color: rgba(7, 11, 28, 0.6);
      margin-top: 22rpx;
    }
    &:nth-child(1),
    &:nth-child(2) {
      &:after {
        content: "";
        display: block;
        width: 1rpx;
        height: 40rpx;
        background: #e9e9ea;
        position: absolute;
        right: 0;
      }
    }
  }
}
</style>
